import backtrader as bt


# 创建大脑
cerebro = bt.Cerebro()

# 投喂数据
data = bt.BackBrokerCSVData(dataname="", timeframe=bt.TimeFrame.Days)

# 添加策略
MyStrategy = None
value1 = None
value2 = None
cerebro.addstrategy(MyStrategy, myparam1=value1, myparam2=value2)

# 自定义功能
# addwriter
# addanalyzer
# addobserver

# 设置交易环境/经纪人（佣金，杠杆）
class MyBroker:
    pass

broker = MyBroker()
cerebro.broker = broker

# 运行策略
cerebro.run()

# 绘图
cerebro.plot()